// 2025/9/27
// 在字符串中找出连续最长数字串

#include <iostream>
using namespace std;

int main() {
    string str; cin >> str;
    int n = str.size();
    int ansl = 0, ansr = 0;
    for(int l = 0, r = 0; r < n; r++)
    {
        if('0' <= str[r] && str[r] <= '9')
        {
            l = r;
            while(r < n && '0' <= str[r] && str[r] <= '9')
            {
                r++;
            }
            if(r - l > ansr - ansl)
            {
                ansr = r;
                ansl = l;
            }
        }
    }
    string ans = str.substr(ansl, ansr - ansl);
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")